package io;

import java.io.*;
import java.util.Scanner;

/**
 * 说明:
 *
 * @author:SuZhongHe
 * @date:2023/3/9
 **/
public class PWDemo2 {
    public static void main(String[] args) throws FileNotFoundException {
        FileOutputStream fos = new FileOutputStream("pw.txt");
        OutputStreamWriter osw = new OutputStreamWriter(fos);
        BufferedWriter bw = new BufferedWriter(osw);
        PrintWriter pw = new PrintWriter(bw,true);
        Scanner scanner = new Scanner(System.in);
        while (true){
            String s = scanner.nextLine();
            if ("exit".equals(s)){
                break;
            }
            pw.println(s);
        }
    }
}
